﻿#include "SLT_tcpSenderImpl.h"
#include "SLT_tcpServerImpl.h"
#include "SLT_tcpSender.h"
#include "SLT_csConnect.h"   //只是为了编译

SLT_API  void             SLT_setTcpRecvMsgCb(SLT_tcpRecvMsgCb_type _fun)
{
	SLT_tcpSenderProtocolImpl::m_precvMsgCBFun = _fun;
}

SLT_API SLT_TCPSenderPtr  SLT_getTcpClientSender(SLTcpClientPtr &_client,const std::string& _rip, uint16_t _rport, bool reuse)
{
	return SLT_tcpServerFrameImpl::getInst()->getSender(_client,_rip,_rport,reuse);
}
SLT_API SLT_TCPSenderPtr  SLT_getTcpServerSender(SLTcpClientPtr& _client)
{
	SLT_tcpSenderProtocolImplSptr sender = SLT_tcpServerFrameImpl::getInst()->newSender();
	sender->recvConnect(_client);
	return sender;
}
SLT_API SLT_TCPSenderPtr  SLT_getProxyClientSender(SLTcpClientPtr &_client,const std::string& _rip, uint16_t _rport,
		                int _prefix1, int _prefix2, int _prefix3,int _devno,int _subno,const std::string &_svrid,int _encrypt,int _timeout_ms)
{
	return SLT_tcpServerFrameImpl::getInst()->getProxySender(_client,_rip,_rport,_prefix1,_prefix2,_prefix3,_devno,_subno,_svrid,_encrypt,_timeout_ms);
}